package com.taotao.slink.mapper;


import com.gitee.fastmybatis.core.mapper.CrudMapper;
import com.github.pagehelper.Page;
import com.taotao.slink.model.entity.DayVisit;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
* 日访问量统计DAO
*
* @author youbeiwuhuan
* @date 2023-06-27 12:08:05
*/
public interface DayVisitMapper extends CrudMapper<DayVisit/*实体类*/, Long/*主键类型*/> {

    /**
    * 分页查询
    *
    * @param param    查询参数
    * @param pageNum  页号
    * @param pageSize 页大小
    * @return
    */
    Page<DayVisit> selectByPage(
        @Param("param") DayVisit param,
        @Param("pageNum") int pageNum,
        @Param("pageSize") int pageSize);

    DayVisit selectByCodeAndDay(@Param("code")String code, @Param("day")LocalDate day);

    int addVisitCount(@Param("code")String code, @Param("day")LocalDate day, @Param("count")int count, @Param("version") Long version,@Param("opTime")  LocalDateTime opTime);
}